import time
def sortirovka(c):
    f=True
    while f:
        f=False
        for i in range(len(c)-1):
            if c[i]>c[i+1]:
                c[i], c[i+1]=c[i+1],c[i]
                f=True
z=list(map(int,open('m1_sorted.txt').read().splitlines()))
y=list(map(int,open('m2_reverse.txt').read().splitlines()))
x=list(map(int,open('m3_shuffle.txt').read().splitlines()))
t0=time.time()
sortirovka(z)
t=time.time()
print("m1_sorted",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(y)
t=time.time()
print("m2_reverse",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(x)
t=time.time()
print("m3_shuffle",round((t-t0)*1000),"milliseconds")
